<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小三角</title>
    <style>
        .box {
            width: 150px;
            height: 10px;
            margin: 100px auto;
        }
        .box1 {
            float: right;
            width: 100%;
            height: 200px;
            background-color: thistle;
        }
        .box2 {
            float: right;
            width: 0;
            height: 0;
            margin-right: 10px;
            border: 8px solid transparent;
            border-bottom-color: thistle;
            line-height: 0;
            font-size: 0;
        }
        .box3 {
            position: relative;
            width: 150px;
            height: 200px;
            background-color: thistle;
        }
        .box4 {
            position: absolute;
            width: 0;
            height: 0;
            border: 8px solid red;
            line-height: 0;
            font-size: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <span class="box2"></span>
        <div class="box1"></div>
    </div>
    
    <div class="box3">
        <span class="box4"></span>
    </div>
</body>
</html>